<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class StringUtils {
	
	public static function addUnderscore($string) {
		
		return preg_replace('/\s/i', '_', $string);
		
	}
	
	public static function concat($array,$delimiter=" "){
		$string = "";
		foreach ($array as $val) {
			$v = trim($val);
			$string .= ($v != "")?$delimiter . $v:"";
		}
		return $string;
	}

}